Cocktail Help Reference
FindAsync(Expression<Func<T,Boolean>>,CancellationToken,Func<IQueryable<T>,IOrderedQueryable<T>>,Action<IFetchOptions<T>>) Method
See Also  Send Feedback
Cocktail Assembly > Cocktail Namespace > Repository<T> Class > FindAsync Method : FindAsync(Expression<Func<T,Boolean>>,CancellationToken,Func<IQueryable<T>,IOrderedQueryable<T>>,Action<IFetchOptions<T>>) Method



predicate
Optional predicate to filter the returned list of entities
cancellationToken
A token that allows for the operation to be cancelled.
orderBy
Optional sorting function to sort the returned list of entities.
fetchOptions
Optional delegate to specify additional fetching options.

Glossary Item Box

Retrieves one or more entities matching the provided expression with the repository's default query strategy.

Syntax

Visual Basic (Declaration) 
Public Overloads Function FindAsync( _
   ByVal predicate As Expression(Of Func(Of T,Boolean)), _
   ByVal cancellationToken As CancellationToken, _
   Optional ByVal orderBy As Func(Of IQueryable(Of T),IOrderedQueryable(Of T)), _
   Optional ByVal fetchOptions As Action(Of IFetchOptions(Of T)) _
) As Task(Of IEnumerable(Of T))
Visual Basic (Usage)Copy Code
Dim instance As Repository(Of T)
Dim predicate As Expression(Of Func(Of T,Boolean))
Dim cancellationToken As CancellationToken
Dim orderBy As Func(Of IQueryable(Of T),IOrderedQueryable(Of T))
Dim fetchOptions As Action(Of IFetchOptions(Of T))
Dim value As Task(Of IEnumerable(Of T))
 
value = instance.FindAsync(predicate, cancellationToken, orderBy, fetchOptions)

Parameters

predicate
Optional predicate to filter the returned list of entities
cancellationToken
A token that allows for the operation to be cancelled.
orderBy
Optional sorting function to sort the returned list of entities.
fetchOptions
Optional delegate to specify additional fetching options.

Return Value

The list of retrieved entities.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.